package com.bthdung.studios.lesson12.framework.buffers;

import java.nio.ShortBuffer;

import android.opengl.GLES20;

public class IndexBuffer
{
	ShortBuffer buffer = null;
	int bufferID = -1;

	public IndexBuffer(short[] data)
	{
		buffer = BufferUtils.createShortBuffer(data);
		bufferID = BufferUtils.glGenerateIndexBuffer(buffer);		
	}

	public void glBind()
	{
		GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, bufferID);
	}
	
	public int glGetCapacity()
	{
		return buffer.capacity();
	}

	public int glGetID()
	{
		return bufferID;
	}
}
